package com.spring.cloud.examples.controller;


import com.spring.cloud.examples.service.Service2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/service2")
public class Service2Controller {

    @Autowired
    private Service2 service2;

    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    @ResponseBody
    public String insertService2()
    {
        service2.insertService2();
        return "测试全局事务";
    }
}
